<?php

namespace App\Http\Controllers\Index;


use Illuminate\Http\Request;

class UserAuth extends Base
{

    public $userName = '';
    public $userId = '';
    public function __construct(Request $request)
    {
//        var_dump(session('user'));

//        if(!$request->session()->get('user')){//判断用户未登录就跳转至登录页面
//
//                redirect('/login')->send();
//        }
        session(['user'=>['userId'=>8,'userName'=>'无名小伙伴18225515455']]);
        $user = $request->session()->get('user');
        $this->userId = $user['userId'];
        $this->userName = $user['userName'];

    }


}
